package cn.itcast.com.day08;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

/*

1.子类是否可以和父类一模一样
2.如果可以，访问的究竟是哪一个
3
 */
public class override {
    public static void main(String[] args) {
        OverrideSon overrideSon = new OverrideSon();

//        overrideSon.sonAccess();
//        overrideSon.fatherAccess();
        overrideSon.allAccess();
    }
}

class OverrideFather{
    public void samemehod(){
        System.out.println("fathter");
    }
    public void fatherAccess(){
        samemehod();
    }
}

class OverrideSon extends OverrideFather{
    public void samemehod(){
        System.out.println("son");
    }
    public void sonAccess(){
        samemehod();
    }

    public void allAccess(){
        samemehod();
        super.samemehod();
    }
}

